package cn.mccraft.uide.api.plugin.extension;

import java.net.URL;
import java.nio.file.Path;
import java.util.Optional;

import javax.annotation.Nonnull;

import com.google.common.reflect.TypeToken;

import cn.mccraft.uide.api.project.Project;
import ro.fortsoft.pf4j.ExtensionPoint;

public interface ProjectProvider<T extends Project> extends ExtensionPoint {

	@Nonnull
	default TypeToken<T> getType() {
		return new TypeToken<T>() {};
	}

	Optional<T> createProject(String name);
	
	Optional<T> loadProject(Path path);

	@Nonnull
	String getProjectName();

	@Nonnull
	String getLocalizedProjectName();

	Optional<URL> getProjectIcon();
}
